import request from '/@/utils/request';

export function dictApi() {
  return {
    treeData:()=>{
      return request({
				url: '/admin/dict/data_tree',
				method: 'get'
			})
    },

    dataList:(params:object)=>{
      return request({
        url:'/admin/dict/data_list',
        method:'post',
        data : params
      })
    },

    delete:(id:number)=>{
      return request({
        url:'/admin/dict/delete',
        method:'post',
        data : {id:id}
      })
    },

    disenabled:(id:number)=>{
      return request({
        url:'/admin/dict/disenabled',
        method:'post',
        data : {id:id}
      })
    },

    save:(params:object)=>{
      return request({
        url:'/admin/dict/save',
        method:'post',
        data : params
      })
    },

    detail:(id:number)=>{
      return request({
        url:'/admin/dict/detail',
        method:'post',
        data : {id:id}
      })
    },
  }
}